home *** CD-ROM | disk | FTP | other *** search
/ Space & Astronomy / Space and Astronomy (October 1993).iso / pc / programs / mac / almanac.sit / Almanac v1.8 / stack_-1.xml < prev    next >
Extensible Markup Language  |  1990-04-21  |  8KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in.8</name>
  5.     <id>-1</id>
  6.     <cardCount>16</cardCount>
  7.     <cardID>2966</cardID>
  8.     <listID>12092</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>on ftype fname,numget number of lines of cd fld fnameif it <num+1 thenset style of cd fld fname to rectangleelseset style of cd fld fname to scrollingset scroll of cd fld fname to 0end ifend ftypeon openStackglobal force,intl,totalif the version < "1.2" thenAsk "This stack requires HyperCard 1.2.1 or newer" with "Drat!"go recent cdend ifgo cd 1put false into totalput empty into intlset lockscreen to trueset lockmessages to truepush cdgo second cdif number of cd flds >0 then put true into totalpop cdset lockscreen to falseset lockmessages to falseput false into forcehide message boxput the seconds/86400 + 16480.5 + DSTCheck()/24 into jd2put trunc(jd2+24000000) +1 into jdget the long dateif first word of cd fld daily is not in it thenbeepput "Polynomials are outdated..."wait 1 sechide message boxend ifput "Dimanche,Lundi,Mardi,Mercredi,Jeudi,Vendredi,Samedi" into frdaysif first word of it is in frdays then put "Fr" into intlget the dateif it contains "." then put "De" into intlconvert it to dateItemsif intl = "De" thenrepeat with i=1 to number of chars of itif char i of it = "." then put "," into char i of itend repeatput item 1 of it into dput item 2 of it into melse if intl = "Fr" thenput item 2 of it into dput item 3 of it into melseput item 2 of it into mput item 3 of it into dend ifput false into valif intl is empty thenif m>4 and m<=10 then put true into valput trunc(jd-7*trunc(jd/7)) into wif m=4 and d>=w-1 then put true into valif m=10 and (d-w)>=25 then put false into valset hilite of bkgnd button "DST" of cd origin to valif val thenput "D" into char 3 of last word of cd fld coords of cd originelseput "S" into char 3 of last word of cd fld coords of cd originend ifend ifpush cdif the short name of this cd is "origin" thenput line 2 of cd fld "Algol" into eclrepeatif ecl > jd2 then exit repeatadd 2.8673075 to eclend repeatset numberFormat to "0.0"put "Next minimum of Algol occurs in" && (ecl-jd2)*24 &&┬¼"hours at JD=" into line 1 of cd fld Algolset numberFormat to "0.###"put ecl+2400000 after line 1 of cd fld Algolput ecl into line 2 of cd fld Algolend ifend openStackfunction nDate Uflag,Jflag,n-- Uflag =0 for no UT, 1 for UT-- Jflag =12 for JT, 0 for no JT-- n = # days after given dateglobal intlget the secondsadd 86400*n+3600*(Jflag+Uflag*DSTcheck()) to itconvert it to long dateif intl = "De" thenput char 1 to (offset(".",second word of it)-1) of second word of it ┬¼&& third word of it && last word of it into heelse if intl = "Fr" thenput second word of it && third word of it && last word of it into heelseput char 1 to (offset(",",third word of it)-1) of third word of it ┬¼&& second word of it && last word of it into heend ifreturn heend nDatefunction rnd10 xreturn round(x*10)/10end rnd10function DSTcheckget first word of line 4 of cd fld Coords of cd originif hilite of bkgnd button "DST" of cd originthen put it-1 into tempelse put it into tempreturn tempend DSTcheckfunction frac xreturn x-trunc(x)end fracfunction sgn xif x<0 thenget -1else if x=0 thenget 0else if x>0 thenget 1end ifreturn itend sgnfunction sind nreturn sin((n mod 360)*pi/180)end sindfunction cosd nreturn cos((n mod 360)*pi/180)end cosdfunction tand nreturn tan((n mod 360)*pi/180)end tandon dayOfYear-- returns day, dayUT as number of day in yearglobal dayUT,day,daySecs,intlput the date into daysecsif intl is "De" thenrepeat with i=1 to number of chars of daysecsif char i of daysecs = "." then put "/" into char i of daysecsend repeatend ifput number of chars of the date into ndateif intl is "Fr" then-- swap months and days of daysecsput 0 into jrepeat with i=1 to number of chars of daysecsif char i of daysecs = "/" thenadd 1 to jput i into item j of posend ifend repeatput item 1 of pos into c1put item 2 of pos into c2put char 1 to c1-1 of daysecs into iput char c1+1 to c2-1 of daysecs into jput char c2+1 to (number of chars of daysecs) of daysecs into kput j&"/"&i&"/"&k into daysecsend ifput "12/31/" & (char ndate-1 to ndate of the date)-1 into Jan0convert daySecs to secondsconvert Jan0 to secondsput (daySecs-Jan0)/86400 into dayput (daySecs-Jan0+3600*DSTcheck())/86400 into dayUTif intl is "Fr" then put "day = "&&dayend dayOfYearon cheb a,b,cglobal x,xa,xbput 2*x*a-b+c into tempput a into xbput temp into xaend chebon UTglobal day,daySecs,x,xa,xb,mdayOfYear -- gets daySecsget ((the seconds-daySecs)/3600+DSTcheck())mod 24put trunc(it) into hput trunc(60*(it-h)) into mif m<10 then put "0" before mif h=0 then put "0" before hput "Universal Time = "& h &":" & m into line 1 of fld UTput it into line 2 of fld UTend UTon STglobal day,daySecs,x,xa,xb,dayUTdayOfYear -- gets dayput (dayUT-1)/183-1 into xput 0 into aput 0 into bput 7 into irepeat until i=0cheb a,b,word i+1 of cd fld "Sidereal Cheb" of cd originput xa into aput xb into bsubtract 1 from iend repeatput xb into b2cheb a,b,word 1 of cd fld "Sidereal Cheb" of cd originget ((xa-b2)/2+((the seconds-daySecs)/3600+DSTcheck())*1.00273791+┬¼(line 2 of cd fld "coords" of cd origin)/15+24) mod 24put trunc(it) into hput trunc(60*(it-h)) into mif m<10 then put "0" before mif h=0 then put "0" before hput "Sidereal Time = "& h &":" & m into line 1 of fld STput it into line 2 of fld STend STon hm decv,argglobal h,mput trunc(arg) into hput trunc(60*(arg-h)) into mif decv then put abs(m) into mif m<10 then put "0" before mend hmfunction atanq x,yget atan(y/x)if x>0 then add pi to itreturn it mod (2*pi)end atanqon moonposglobal t,dra,decra,dec,facset cursor to busyput 218.32+481267.883*t+6.29*sind(134.9+477198.85*t)-1.27*┬¼sind(259.2-413335.38*t)+.66*sind(235.7+890534.23*t)+.21*sind(┬¼269.9+954397.7*t)-.19*sind(357.5+35999.05*t)-.11*sind(186.6+┬¼966404.05*t) into lambdaput 5.13*sind(93.3+483202.03*t)+.28*sind(228.2+960400.87*t)┬¼-.28*sind(318.3+6003.18*t)-.17*sind(217.6-407332.2*t) into betaput cosd(beta)*cosd(lambda) into lset cursor to busyput .9175*cosd(beta)*sind(lambda)-.3978*sind(beta) into mput .3978*cosd(beta)*sind(lambda)+.9175*sind(beta) into nput (180+atanq(l,m)/fac) mod 360 into draput dra/15 into decraput atan(n/sqrt(1-n*n))/fac into decend moonposon calc num,forceglobal day,daySecs,x,xa,xb,dayUT,it,h,m,mode,t,dec,decra,dra,fac-- calcs ra and dec, force =true means do it anywayset cursor to 1001dayOfYear -- gets day,dayUTput pi/180 into facget line 3 of fld UTput line 1 of cd fld "Coords" of cd origin into latif (it=trunc(dayUT) and the optionkey is up) and not force thenput line 5 of fld Pos into draput line 6 of fld Pos into decput line 3 of fld rise into argelseset cursor to 1002if short name of this cd is "Moon" then-- Moon calcs from A.A.put ((last word of line 1 of fld JD)-2451545)/36525 into tmoonposelseput trunc(dayUT) into line 3 of fld UTput (dayUT+((the seconds-daySecs)/3600+DSTcheck())/24-1)/183-1 ┬¼into xput 0 into aput 0 into bput num into irepeat until i=0set cursor to busycheb a,b,word i+1 of fld "ra cheb"put xa into aput xb into bsubtract 1 from iend repeatput xb into b2cheb a,b,word 1 of fld "ra cheb"put (((xa-b2)/2+48) mod 24) *15 into draput dra/15 into decraput 0 into aput 0 into bput num into irepeat until i=0set cursor to busycheb a,b,word i+1 of fld "dec cheb"put xa into aput xb into bsubtract 1 from iend repeatput xb into b2cheb a,b,word 1 of fld "dec cheb"get (xa-b2)/2put it into decif "Sun" is in short name of this cd then-- use -12 for twi